package edu.hunau.cxb19.oop.class12;

import org.junit.Test;

/**
 *
 * @author hb
 *
 *         2020-03-11 16:23:40
 */
public class StringExTest {

	@Test
	public void test() {
		String s1 = "string_s1";
		String s2 = "string_s2";
		changeString(s1, s2);
		System.out.println("s1=" + s1 + ",s2=" + s2);//s1=string_s1,s2=string_s2

		StringBuilder sb1 = new StringBuilder("sb_sb1");
		StringBuilder sb2 = new StringBuilder("sb_sb2");
		changeStringBuilder(sb1, sb2);
		System.out.println("sb1=" + sb1 + ",sb2=" + sb2);//sb1=sb_sb1,sb2=sb_sb2_Append
	}

	public void changeStringBuilder(StringBuilder sb1, StringBuilder sb2) {
		sb1 = sb2;
		sb1.append("_Append");

	}

	public void changeString(String s1, String s2) {
		s1 = s2;
		s1 += "_Add";
	}
}
